<template>
  <div v-if="item.examType === 1">
    <div>
      有效期：<span v-if="item.validityDateType === 1">长期有效</span>
      <span v-if="item.validityDateType === 2">{{ item.days }}天</span>
      <span v-if="item.validityDateType === 3">{{ item.beginTime }}~{{ item.endTime }}</span>
    </div>
    <div>
      考试次数：<span v-if="item.examCount > 0">最多可考 {{ item.examCount }} 次</span><span v-else>不限次数</span>
    </div>
  </div>
  <div v-if="item.examType === 2">
    <div>
      报名时间：{{ item.registrationStartTime }} ~ {{ item.registrationEndTime }}
      <span v-if="item.registrationStatus">【<common-enum-view :enum-value="item.registrationStatus" :custom-list="registrationStatusList" />】</span>
    </div>
    <div>
      <span>开考时间：{{ item.examStartTime }}</span>
      <span class="ml20">
        报名限制：
        <span v-if="item.registrationUserLimitCount > 0">最多允许 {{ item.registrationUserLimitCount }} 人报名</span>
        <span v-else>不限人数</span>
      </span>
    </div>
  </div>
</template>
<script setup>
  import { registrationStatusList } from '~/utils/constants'
  const props = defineProps({
    item: { type: Object, default: () => {} }
  })
  const { item } = toRefs(props)
</script>
<style lang="scss" scoped></style>
